package br.igk.isnmp.util;

import br.igk.isnmp.core.SNMPObject;
import br.igk.isnmp.core.SNMPObjectIdentifier;
import br.igk.isnmp.core.SNMPSequence;

public class SNMPEntry {
	private SNMPObjectIdentifier snmpOID;
	private SNMPObject snmpValue;

	public SNMPEntry(SNMPSequence pair) {
		this.snmpOID = (SNMPObjectIdentifier)pair.getSNMPObjectAt(0);
		this.snmpValue = pair.getSNMPObjectAt(1);
	}

	public SNMPObjectIdentifier getSnmpOID() {
		return snmpOID;
	}

	public void setSnmpOID(SNMPObjectIdentifier snmpOID) {
		this.snmpOID = snmpOID;
	}

	public SNMPObject getSnmpValue() {
		return snmpValue;
	}

	public void setSnmpValue(SNMPObject snmpValue) {
		this.snmpValue = snmpValue;
	}

	public String toJsonString() {
		return "{OID: "+ this.snmpOID +", type: "+ this.snmpValue.getClass().getCanonicalName() +", value: "+ this.snmpValue.toString() +"}";
	}
}
